package com.scf.fruit.business.order.controller;

import com.scf.fruit.business.order.bo.OrderBo;
import com.scf.fruit.util.ResponseVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author : 孙超飞
 * @title :
 * @description :
 * @copyright :
 * @date : 2018-05-21 18:01
 */
@Controller
@RequestMapping(value = "/order",produces = "application/json")
public class OrderController {
    @Resource
    private OrderBo orderBo;

    @ResponseBody
    @RequestMapping(value = "/queryOrderByPage",method = RequestMethod.GET)
    public ResponseVo queryOrderByPage(@RequestParam("pageNum")Integer pageNum,@RequestParam("length")Integer length){
        return orderBo.queryOrderByPage(pageNum,length);
    }

    @ResponseBody
    @RequestMapping(value = "/queryOrderDetail",method = RequestMethod.GET)
    public ResponseVo queryOrderDetail(@RequestParam("orderId")Long orderId){
        return orderBo.queryOrderDetail(orderId);
    }
}
